package sem;

import com.ibm.tspaces.TupleSpace;
import com.ibm.tspaces.TupleSpaceException;

public class Client {
	
	private Semaphore sem;
	
	public Client(boolean init, String tag, TupleSpace space)
	throws TupleSpaceException
	{
		this.sem = new Semaphore(tag, space);
		
		if(init)
			sem.init(2);
	}
	
	
	public void work() 
	throws TupleSpaceException
	{
		sem.P();
		System.out.println("Cliente");
	}
	
}
